import request from './request'
import qs from "qs"
export const getVerifyApi = phone => request.post('/sendSMS', `phone=${phone}`)
export const phoneLoginApi = data => request.post('/phoneRegin', `verifyCode=${data.code}&phone=${data.phone}`)

export const getUserInfoApi = () => request.get('/shop/userProfiles')

// 微信登录（这个接口必须用qs对数据进行格式化）
export const WXLoginApi = code => request.post('/wechatUsers/PCLogin', `code=${code}`)

// 精品推荐数据
export const getRecommenApi = () => request.get('/products/recommend')
//热门的数据
export const getHotApi = () => request.get('/products/hot')
export const getMorApi = params => request.get('/products', { params })

export const GoodDetailApi = params => request.get(`/products/${params}`)

//购物车
export const getGwcApi = params => request.post('/shop/carts/add', qs.stringify(params))